﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;

public partial class public_roleman : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["organizationid"] != null)
        {
            writerole();
        }
        else
        {
            MasApp.BLL.ResponseHelper.alert("尚未登录！", "../default.aspx");
        }
    }
    public void writerole()
    {
        if (Session["userid"] != null && Session["userid"].ToString() != "")
        {
            DataSet ds = MasApp.BLL.Search.SearchRoleIDandName(int.Parse(Session["userid"].ToString()));
            for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
            {
                if (ds.Tables[0].Rows[i]["roleid"].ToString() == "1")
                {
                    roleid1.Visible = true;
                }
                if (ds.Tables[0].Rows[i]["roleid"].ToString() == "2")
                {
                    roleid2.Visible = true;
                }
                if (ds.Tables[0].Rows[i]["roleid"].ToString() == "3")
                {
                    roleid3.Visible = true;
                }
                if (ds.Tables[0].Rows[i]["roleid"].ToString() == "4")
                {
                    roleid4.Visible = true;
                }
                if (ds.Tables[0].Rows[i]["roleid"].ToString() == "5")
                {
                    roleid5.Visible = true;
                }
                if (ds.Tables[0].Rows[i]["roleid"].ToString() == "6")
                {
                    roleid6.Visible = true;
                }
                if (ds.Tables[0].Rows[i]["roleid"].ToString() == "7")
                {
                    roleid78.Visible = true;
                }
                if (ds.Tables[0].Rows[i]["roleid"].ToString() == "8")
                {
                    roleid78.Visible = true;
                }
                if (ds.Tables[0].Rows[i]["roleid"].ToString() == "9")
                {
                    roleid9.Visible = true;
                }
                if (ds.Tables[0].Rows[i]["roleid"].ToString() == "10")
                {
                    roleid10.Visible = true;
                }
            }
        }
    }
}
